/**
 * 
 */
package com.effectiv.gooruda.rest.api.operation;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import com.effectiv.gooruda.rest.api.domain.FileStorage;

/**
 * @author Dhrubo
 *
 */
public interface FileStorageOperation {
	FileStorage store(String userName, String folder, String description, String tags, MultipartFile file);
	FileStorage update(String fileName, String folder, String description,  MultipartFile file);
	
	
	boolean addTags(String fileName, String folder,  String tags);
	boolean removeTags(String fileName, String folder, String tags);
	boolean removeAllTags(String fileName,  String folder);
	
	boolean removeOwner(String fileName, String folder);
	boolean changeOwner(String fileName, String folder, String oldOwner, String newOwner);
	
	
	FileStorage moveFolder(String fileName, String oldFolder, String newFolder);
	boolean deleteFolder(String folder);
	boolean renameFolder(String oldFolder, String newFolder);
	
	String deleteByUser(String userName);
	String deleteByName(String fileName);
	String deleteAllByUser(String userName);
	String deleteAll();
	
	long countByType(String type);
	long countByUser(String userName);
	long count();
	
	List<FileStorage> findByType(String type, Pageable page);
	List<FileStorage> findByOwner(String userName, Pageable page);
	List<FileStorage> findAll(Pageable page);
	List<FileStorage> findByTags(String tags[], Pageable page);
	
	byte [] download(String fileName);
	
	FileStorage findByName(String fileName, Pageable page);
	
	
}
